<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('门店管理列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label>门店名称：</label>
                                <select name="shopName">
                                    <option value="">所有</option>
                                    <option value="-1">代码生成请选择字典属性</option>
                                </select>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="smdd:mdgl:add">
                    <i class="fa fa-plus"></i> 添加
                </a>
                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="smdd:mdgl:edit">
                    <i class="fa fa-edit"></i> 修改
                </a>
                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="smdd:mdgl:remove">
                    <i class="fa fa-remove"></i> 删除
                </a>
                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="smdd:mdgl:export">
                    <i class="fa fa-download"></i> 导出
                </a>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('smdd:mdgl:edit')}]];
        var removeFlag = [[${@permission.hasPermi('smdd:mdgl:remove')}]];
        var prefix = ctx + "smdd/mdgl";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "门店管理",
                columns: [{
                    checkbox: true
                },
                {
                    field: 'id',
                    title: '主键',
                    visible: false
                },
                {
                    field: 'shopName',
                    title: '门店名称'
                },
                {
                    field: 'logoImageId',
                    title: '门店logo'
                },
                {
                    field: 'linkman',
                    title: '联系人'
                },
                {
                    field: 'phone',
                    title: '联系电话'
                },
                {
                    field: 'shopHours',
                    title: '营业时间'
                },
                {
                    field: 'province',
                    title: '所在省份'
                },
                {
                    field: 'city',
                    title: '所在城市'
                },
                {
                    field: 'district',
                    title: '所在区/县'
                },
                {
                    field: 'address',
                    title: '详细地址'
                },
                {
                    field: 'coordinate',
                    title: '门店坐标'
                },
                {
                    field: 'summary',
                    title: '门店简介'
                },
                {
                    field: 'foodMode',
                    title: '点餐模式 1店内就餐 2打包带走 3外卖直达 4到店自取'
                },
                {
                    field: 'tangMode',
                    title: '堂食模式(1选桌 2排号)'
                },
                {
                    field: 'isCheck',
                    title: '自提核销(1开启 0关闭)'
                },
                {
                    field: 'status',
                    title: '门店状态(1开启 0关闭)'
                },
                {
                    field: 'sort',
                    title: '排序(数字越小越靠前)'
                },
                {
                    field: 'wxappId',
                    title: '小程序id'
                },
                {
                    field: 'gmtCreate',
                    title: '创建时间'
                },
                {
                    field: 'gmtModified',
                    title: '更新时间'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>